Best Arduino Project Ideas for Beginners With Code: Step by Step Tutorial Arduino Projects Anyone Can Make Home Security Alarm System, LED Matrix and More. by Wilson John

Best Arduino Project Ideas for Beginners With Code: Step by Step Tutorial Arduino Projects Anyone Can Make Home Security Alarm System, LED Matrix and More. by Wilson John

Author:Wilson John [John, Wilson]
Language: eng
Format: azw3
Published: 2017-10-27T04:00:00+00:00


Code Project

int sensorPin = A0; // select the input pin for the potentiometer

//int ledPin = 13; // select the pin for the LED

int sensorValue = 0; // variable to store the value coming from the sensor

void setup() {

// declare the ledPin as an OUTPUT:

Serial.begin(9600);

pinMode(ledPin, OUTPUT);

pinMode(11,OUTPUT);

}

/*void loop() {

// read the value from the sensor:

sensorValue = analogRead(sensorPin);

// turn the ledPin on

digitalWrite(ledPin, HIGH);

// stop the program for <sensorValue> milliseconds:

delay(sensorValue);

// turn the ledPin off:

digitalWrite(ledPin, LOW);

// stop the program for for <sensorValue> milliseconds:

delay(sensorValue);

}*/

void loop()

{

sensorValue=analogRead(sensorPin);

if(sensorValue <= 14)

digitalWrite(11,HIGH);

else

digitalWrite(11,LOW);

Serial.println(sensorValue);

delay(2);

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.